<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>018案例</title>
</head>

<body>
    <h1>018案例</h1>
    <script>
        let price = +prompt('请输入单价：')
        let num = +prompt('请输入数量：')
        let addr = prompt('请输入地址：')
        document.write(`
        <table>
            <caption>订单确认</caption>
            <thead>
                <tr>
                    <th>名称</th>
                    <th>单价</th>
                    <th>数量</th>
                    <th>总价</th>
                    <th>地址</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>小米</td>
                    <td>${price}</td>
                    <td>${num}</td>
                    <td>${price * num}</td>
                    <td>${addr}</td>
                </tr>
            </tbody>
        </table>
        `)
    </script>
</body>

</html>